colorbutton: Fix drag source
authorBenjamin Otte <otte@redhat.com>
Tue, 18 Feb 2020 01:58:58 +0000 (02:58 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 18 Feb 2020 01:58:58 +0000 (02:58 +0100)
By running it in the capture phase, it will not be starved for events by
the button's click source and make drags actually start a color drag
operation.

gtk/gtkcolorbutton.c

index 86c81830f58b06a9a02019a173d8b224e03deb1a..9c951d21aed9c1c1322a06d5a90b61e4067ef773 100644 (file)
@@ -328,6 +328,7 @@ gtk_color_button_init (GtkColorButton *button)
   source = gtk_drag_source_new ();
   g_signal_connect (source, "prepare", G_CALLBACK (gtk_color_button_drag_prepare), button);
   g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_button_drag_begin), button);
+  gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (source), GTK_PHASE_CAPTURE);
   gtk_widget_add_controller (priv->button, GTK_EVENT_CONTROLLER (source));
 
   gtk_widget_add_css_class (priv->button, "color");